﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WFASmartketing.REPORTES
{
    public partial class ReporteMovimientoCajaWF : Form
    {
        public ReporteMovimientoCajaWF()
        {
            InitializeComponent();
            cbxbanco.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxmovimiento.DropDownStyle = ComboBoxStyle.DropDownList;
            cbxmovimiento.SelectedIndex = 0;
        }

        private void ReporteMovimientoCajaWF_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'cajaDS.caja_selectAll' table. You can move, or remove it, as needed.
            this.caja_selectAllTableAdapter.Fill(this.cajaDS.caja_selectAll);
            // TODO: This line of code loads data into the 'ReporteMovimientoCajaDS.MOVIMIENTOS_CAJA' table. You can move, or remove it, as needed.
            RECARGARGRID();
        }
        private void RECARGARGRID()
        {
            string BANCO = "";
            string MOVIMIENTO = "";
            if (cbxbanco.SelectedText.ToString().Equals("TODOS"))
            {
                BANCO = "%%";
            }
            else
            {
                BANCO = cbxbanco.Text.ToString();
            }
            if (cbxmovimiento.SelectedItem.ToString().Equals("TODOS"))
            {
                MOVIMIENTO = "%%";
            }
            else
            {
                MOVIMIENTO = cbxmovimiento.SelectedItem.ToString();
            }
            DateTime ini = dtcini.Value;
            DateTime fin = dtcfin.Value;
            this.MOVIMIENTOS_CAJATableAdapter.Fill(this.ReporteMovimientoCajaDS.MOVIMIENTOS_CAJA, ini, fin, BANCO, MOVIMIENTO);
            this.reportViewer1.RefreshReport();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            RECARGARGRID();
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void dtcfin_ValueChanged(object sender, EventArgs e)
        {

        }

        private void dtcini_ValueChanged(object sender, EventArgs e)
        {

        }
    }
}
